package com.ruoyi.project.surveys.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.surveys.mapper.SurveysRecordsMapper;
import com.ruoyi.project.surveys.domain.SurveysRecords;
import com.ruoyi.project.surveys.service.ISurveysRecordsService;

/**
 * 填写记录Service业务层处理
 * 
 * @author zhimin-hu
 * @date 2020-05-02
 */
@Service
public class SurveysRecordsServiceImpl implements ISurveysRecordsService 
{
    @Autowired
    private SurveysRecordsMapper surveysRecordsMapper;

    /**
     * 查询填写记录
     * 
     * @param id 填写记录ID
     * @return 填写记录
     */
    @Override
    public SurveysRecords selectSurveysRecordsById(Long id)
    {
        return surveysRecordsMapper.selectSurveysRecordsById(id);
    }

    /**
     * 查询填写记录列表
     * 
     * @param surveysRecords 填写记录
     * @return 填写记录
     */
    @Override
    public List<SurveysRecords> selectSurveysRecordsList(SurveysRecords surveysRecords)
    {
        return surveysRecordsMapper.selectSurveysRecordsList(surveysRecords);
    }

    /**
     * 新增填写记录
     * 
     * @param surveysRecords 填写记录
     * @return 结果
     */
    @Override
    public int insertSurveysRecords(SurveysRecords surveysRecords)
    {
        surveysRecords.setCreateTime(DateUtils.getNowDate());
        return surveysRecordsMapper.insertSurveysRecords(surveysRecords);
    }

    /**
     * 修改填写记录
     * 
     * @param surveysRecords 填写记录
     * @return 结果
     */
    @Override
    public int updateSurveysRecords(SurveysRecords surveysRecords)
    {
        return surveysRecordsMapper.updateSurveysRecords(surveysRecords);
    }

    /**
     * 批量删除填写记录
     * 
     * @param ids 需要删除的填写记录ID
     * @return 结果
     */
    @Override
    public int deleteSurveysRecordsByIds(Long[] ids)
    {
        return surveysRecordsMapper.deleteSurveysRecordsByIds(ids);
    }

    /**
     * 删除填写记录信息
     * 
     * @param id 填写记录ID
     * @return 结果
     */
    @Override
    public int deleteSurveysRecordsById(Long id)
    {
        return surveysRecordsMapper.deleteSurveysRecordsById(id);
    }
}
